<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>德收-收银台-支付平台</title>
<link href="${request.contextPath}/static/css/layout.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="${request.contextPath}/static/js/jquery/jquery-1.11.1.min.js"></script>
</head>
<body>
<!-- 头部信息 -->
<#include "template/header_template.ftl">

<!--公共-和e付logo结束-->
<div class="wrap1000">
    <!--订单详情-->
    <div class="bor-wrap">
      <h4 class="ft22 tit">订单提交成功，还差最后一步，请尽快支付！</h4>
      <div class="zf-style">
          <label class="first clearfix">
              <p class="fl ft16 padL15 txt">订单号：${order.outerTradeNo!''}</p>
              <p class="fr w-gray88 ft14 txt">应付金额：<span class="w-red ft20">¥${order.orderAmount!'0'}</span></p>
          </label>
      </div>
      <div class="orderInf show-order-js">
          <input type="hidden" name="orderId" id="orderId" value="${order.id!''}">
          <input type="hidden" name="client" id="client" value="${client!''}">
          <input type="hidden" name="payId" id="payId" value="${payId!''}">
          <table class="tab01" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="tab-tit">商品：</td>
              <td>${order.prodName!''}</td>
            </tr>
            <tr>
              <td class="tab-tit">简介：</td>
              <td>${order.prodBody!''}</td>
            </tr>
            <tr>
              <td class="tab-tit">收款方：</td>
              <td>${merchant.merchantName!''}</td>
            </tr>
            <tr>
              <td class="tab-tit">交易号：</td>
              <td>${order.id!''}</td>
            </tr>
          </table>
          <a href="javascript:void(0)" class="orderMore">订单详情<i class="i-jt"></i></a>
      </div>
    </div>
    <!--订单详情结束-->
    <!--其他页面公用-选择以下支付方式付款-->
    <div class="bor-wrap">
        <div class="clearfix">
            <h4 class="ft22 tit fl">选择以下支付方式付款</h4>
        </div>
        <div class="bor-tb-wrap" id="zfpt-list">
            <!--支付平台-支付列表-start -->
              <h4 class="ft22 tit">支付平台<!-- <span class="ft14 w-gray88">（大额支付推荐使用支付宝）</span> --></h4>
              <div class="style-a-list clearfix" id="bankListDiv">

                  <#list cashierPayInsts as cahierPayInst>

                      <a <#if cahierPayInst_index == 0> class="cur" </#if> >
                          <input type="hidden" value="${cahierPayInst.instCode}" id="instCode_${cahierPayInst.instCode}" name="instCode_${cahierPayInst.instCode}">
                          <img src="${request.contextPath}/static/${cahierPayInst.icon}" alt="${cahierPayInst.instName}">
                          <i><img src="${request.contextPath}/static/images/zf-cur.gif"></i>
                      </a>
                  </#list>

              </div>
            <!--支付平台-支付列表-end -->
        </div>

        <br />
        <!-- <h4 class="ft16 tit">请在<span class="w-red">&nbsp;&nbsp;尽快 </span>完成支付，避免交易失效</h4> -->
        <br />
        <a class="w-btn-red w-white" onclick="cashierSubmitPay();">确认支付</a>
    </div>
    <!--其他页面公用-选择以下支付方式付款结束-->
</div>

<!-- 底部信息 -->
<#include "template/footer_template.ftl">

<script type="text/javascript" src="${request.contextPath}/static/js/common.js"></script>

<script>

    // 提交支付
    function cashierSubmitPay(){
        var payId = $("#payId").val();
        var client = $("#client").val();
        var bankCode;
        var bankName;

        $("#bankListDiv").find("a").each(function () {
            if($(this).attr("class") == "cur"){
                bankCode = $(this).find("input").val();
                bankName = $(this).find("img").attr("alt");
            }
        });
        $.post("${request.contextPath}/submit_pay",{
            "payId":payId,
            "client":client,
            "bankCode":bankCode,
            "bankName":bankName
        },function(data){
            if(data.respCode == "T"){
                window.location.href = data.result.pay_url;
            }
        });
    }

</script>
</body>
</html>